import {Suspense,ReactNode} from 'react'
import { Navigate } from 'react-router-dom'
import Login from "../pages/login"
interface node {
  children: ReactNode
}
const guard = (props:node) => {
  let node = props.children
  return <>
    <Suspense fallback={<div>Loading...</div>}>
      {node}
    </Suspense>
  </>
}

export default guard



    // let power=JSON.parse(sessionStorage.getItem('power'))
    // let isPower=false
    // for(let i=0;i<power.length;i++){
    //     if(power[i].link==props.path){
    //        isPower=true
    //     }
    // }
    // console.log(isPower);
    // if(isPower){
    //     return props.ele;
    // }else{
    //     return <Navigate to="/login"/>
    // }
    

